A conventional hydraulic dock leveler has a deck assembly which stores horizontally, that is level with the dock floor, and a pivoting lip attached at one end which extends outward to rest on the vehicle which is being loaded. When the dock leveler is stored, the lip pivots to a pendant position with the end of the lip resting in lip keepers mounted on the stationary frame to thereby support the front of the deck assembly in the stored position. Usually the dock operator will return the dock leveler to the stored position when a loading operation is completed. However, if the truck should pull away from the dock before the leveler is restored, some dock levelers have an optional feature which will automatically raise the dock leveler and return it to the stored position. Conventional automatic-return-to-dock mechanisms use several different techniques. One technique uses a mechanical limit switch to sense the extension of the lip hydraulic cylinder to determine the lip position. Although effective when working properly, it is difficult to adjust and is subject to the reliability problems common to mechanical switches. An other system uses two switches, one on the deck and one on the lip, to control the automatic-return-to-dock function. However a switch mounted on the lip is more exposed to damage by the vehicle being loaded, and the rotation of the lip can cause fatigue failure of the wires to the switch. Yet another system uses a proximity switch to sense when the deck is lowered to the frame and a timer to control the hydraulic motor. Since it does not directly sensing lip position this method cannot ensure that the lip is fully closed or that the deck raised sufficiently before the hydraulic system is turned off.